<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%--<%@taglib uri="/struts-tags" prefix="s"%>--%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path + "/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
    <base href="<%=basePath%>">
    <title>My JSP 'TaskPublishing.jsp' starting page</title>

    <meta http-equiv="pragma" content="no-cache">
    <meta http-equiv="cache-control" content="no-cache">
    <meta http-equiv="expires" content="0">
    <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
    <meta http-equiv="description" content="This is my page">

    <meta charset="utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"/>
    <meta name="description" content=""/>
    <meta name="author" content=""/>
    <title>Fobia - Bootstrap 4 Web Application UI Kit</title>
    <!--favicon-->
    <link rel="icon" href="Main/assets/images/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="Main/assets/plugins/summernote/dist/summernote-bs4.css"/>
    <!-- simplebar CSS-->
    <link href="Main/assets/plugins/simplebar/css/simplebar.css" rel="stylesheet"/>
    <!-- Bootstrap core CSS-->
    <link href="Main/assets/css/bootstrap.min.css" rel="stylesheet"/>
    <!-- animate CSS-->
    <link href="Main/assets/css/animate.css" rel="stylesheet" type="text/css"/>
    <!-- Icons CSS-->
    <link href="Main/assets/css/icons.css" rel="stylesheet" type="text/css"/>
    <!-- Sidebar CSS-->
    <link href="Main/assets/css/sidebar-menu.css" rel="stylesheet"/>
    <!-- Custom Style-->
    <link href="Main/assets/css/app-style.css" rel="stylesheet"/>
    <link rel="stylesheet" href="Main/assets/js/reset.css">
    <link rel="stylesheet" href="Main/assets/js/style.css">
    <!--<link href="Main/assets/css/bootstrap-datetimepicker.css" rel="stylesheet" />
    <script src="Main/assets/js/moment-with-locales.js"></script>

    <script src="Main/assets/js/bootstrap-datetimepicker.js"></script>-->

    <!-- Bootstrap core JavaScript-->
    <script src="Main/assets/js/jquery.min.js"></script>
    <script src="Main/assets/js/popper.min.js"></script>
    <script src="Main/assets/js/bootstrap.min.js"></script>

    <!-- simplebar js -->
    <script src="Main/assets/plugins/simplebar/js/simplebar.js"></script>
    <!-- sidebar-menu js -->
    <script src="Main/assets/js/sidebar-menu.js"></script>

    <!-- Custom scripts -->
    <script src="Main/assets/js/app-script.js"></script>

    <script src="Main/assets/plugins/summernote/dist/summernote-bs4.min.js"></script>

</head>

<body>
<div class="wrapper">
    <div class="container-fluid">
        <h4 class="page-title">发布技术文档</h4>
        <hr/>
        <div class="wrapper">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">

                        <div class="content-wrapper">

                            <!-- Right Sidebar -->
                            <div class="col-lg-9 col-md-8">

                                <div class="card mt-3 shadow-none">
                                    <div class="card-body">
                                        <form action="saveAdd" method="post">
                                            <div class="form-group">
                                                <div class="fallback" id="file-dropzone">
                                                    <input name="attachment" type="text" class="form-control"
                                                           placeholder="请填写文档名称">
                                                </div>
                                            </div>
                                            <div class="form-group">
                                                <input type="text" name="type" class="form-control"
                                                       placeholder="请填写类型">
                                            </div>
                                            <div class="form-group" style="z-index: 1000; ">
                                                <!--<div>-->
                                                <input name="date1" type="text" class="form-control"
                                                       style="display:inline;width: 49%;" id="ECalendar_case2" value=""
                                                       placeholder="请选择存入时间" data-ec="">
                                                <div class="ECalendarBox ECalendarNoneSelect"
                                                     style="border-color: rgb(152, 90, 166); left: 0px; top: -310px; display: none;">

                                                    <div class="head"
                                                         style="border-color: rgb(152, 90, 166); background: rgb(152, 90, 166);">
                                                        <div class="currentdate"><h2><span class="iyear"><span class="">2017</span></span>/<span
                                                                class="imonth"><span class="">3</span></span></h2>
                                                            <ul class="oper">
                                                                <li>&lt;</li>
                                                                <li>&gt;</li>
                                                            </ul>
                                                        </div>
                                                        <div class="currenttime"><span class="ilasttext"><span
                                                                class="itime">1195</span> 天前</span><span
                                                                class="itime itimebox">15:10</span></div>
                                                        <ul class="select">
                                                            <li>今天</li>
                                                            <li>一周后</li>
                                                            <li>一月后</li>
                                                            <li>三月后</li>
                                                            <li>一年后</li>
                                                        </ul>
                                                        <ul class="week">
                                                            <li>一</li>
                                                            <li>二</li>
                                                            <li>三</li>
                                                            <li>四</li>
                                                            <li>五</li>
                                                            <li>六</li>
                                                            <li>日</li>
                                                        </ul>
                                                    </div>
                                                    <ul class="day">
                                                        <li class="other prve">27</li>
                                                        <li class="other prve">28</li>
                                                        <li class="" data="1">1</li>
                                                        <li data="2">2</li>
                                                        <li data="3">3</li>
                                                        <li data="4">4</li>
                                                        <li data="5">5</li>
                                                        <li data="6">6</li>
                                                        <li data="7">7</li>
                                                        <li data="8">8</li>
                                                        <li data="9">9</li>
                                                        <li data="10">10</li>
                                                        <li data="11">11</li>
                                                        <li data="12">12</li>
                                                        <li data="13">13</li>
                                                        <li data="14">14</li>
                                                        <li data="15">15</li>
                                                        <li data="16">16</li>
                                                        <li data="17" class="activ"
                                                            style="background: rgb(152, 90, 166);">17
                                                        </li>
                                                        <li data="18">18</li>
                                                        <li data="19">19</li>
                                                        <li data="20">20</li>
                                                        <li data="21">21</li>
                                                        <li data="22">22</li>
                                                        <li data="23">23</li>
                                                        <li data="24">24</li>
                                                        <li data="25">25</li>
                                                        <li data="26">26</li>
                                                        <li data="27">27</li>
                                                        <li data="28">28</li>
                                                        <li data="29">29</li>
                                                        <li data="30" class="">30</li>
                                                        <li data="31">31</li>
                                                        <li class="other next">1</li>
                                                        <li class="other next">2</li>
                                                        <li class="other next">3</li>
                                                        <li class="other next">4</li>
                                                        <li class="other next">5</li>
                                                        <li class="other next">6</li>
                                                        <li class="other next">7</li>
                                                        <li class="other next">8</li>
                                                        <li class="other next">9</li>
                                                    </ul>
                                                </div>

                                            </div>
                                            <div class="form-group">
                                                <textarea name="content" class="form-control" id="summernoteEditor"
                                                          placeholder="Message body" style="height: 200px"></textarea>
                                            </div>
                                            <div class="form-group">
                                                <button type="submit" id="sub"
                                                        class="btn btn-primary waves-effect waves-light m-1" value="提交">
                                                    <i class="fa fa-floppy-o mr-1"></i>提交
                                                </button>
                                                <button type="reset"
                                                        class="btn btn-danger waves-effect waves-light m-1"><i
                                                        class="fa fa-trash-o mr-1"></i> 删除
                                                </button>
                                            </div>
                                        </form>
                                    </div>
                                    <!-- card body -->
                                </div>
                                <!-- card -->
                            </div>
                            <!-- end Col-9 -->
                        </div>
                        <!-- End row -->
                    </div>
                </div>
            </div>
        </div>
        <!-- End row -->

    </div>
    <!-- End container-fluid-->
    <!-- End container-fluid-->
</div>
<script src="Main/assets/js/Ecalendar.jquery.min.js"></script>

<!--Sweet Alerts -->
<script src="Main/assets/plugins/alerts-boxes/js/sweetalert.min.js"></script>
<script type="text/javascript">
    $(function () {
        $("#ECalendar_case2").ECalendar({
            type: "time",
            offset: [0, 2]
        });
        // $("#ECalendar_case3").ECalendar({
        //     type: "time",
        //     offset: [0, 2]
        // });

    })
</script>

</body>

<script>
    $('#summernoteEditor').summernote({
        height: 400,
        tabsize: 2
    });
</script>
<script>
    var aa = 0;

    function onClickCn(data) {
        onClickOne(aa);
        //			document.getElementById("optgroup_Cname").innerHTML +=
        //			"";
    }

    function onClickOne(int) {
        if (int == 0) {
            aa++;
            document.getElementById("head_op").remove();
            listcoursejson();
        }
    }
</script>

<script>
    function sweet() {
        var T1 = document.getElementById("ECalendar_case2").value;
        var T2 = document.getElementById("ECalendar_case3").value;
        var oDate1 = new Date(T1);
        var oDate2 = new Date(T2);
        if (oDate1.getTime() > oDate2.getTime()) {
            swal({
                title: "时间选择错误，开始时间要比结束时间早哦！",			//弹出标题
//                  text: "该操作会删除该教师信息!",			//弹出文本
                icon: "error",				//警告图标   还有success error  info  不填就是不显示，默认不显示
//                  buttons: true,
                dangerMode: true,
            })
        } else {
            var sub = document.getElementById("sub");
            sub.type = "submit";
            sub.click();

        }

    }


    var aa = 0;

    function onClickCn(data) {
        onClickOne(aa);
        //			document.getElementById("optgroup_Cname").innerHTML +=
        //			"";
    }

    function onClickOne(int) {
        if (int == 0) {
            aa++;
            document.getElementById("head_op").remove();
            listcoursejson();
        }
    }
</script>

<script>
    var aa = 0;

    function onClickCn(data) {
        onClickOne(aa);
        //			document.getElementById("optgroup_Cname").innerHTML +=
        //			"";
    }

    function onClickOne(int) {
        if (int == 0) {
            aa++;
            document.getElementById("head_op").remove();
            listcoursejson();
        }
    }
</script>

<script>
    function listcoursejson() {

        $.ajax({
            url: 'listcoursejson',
            dataType: 'json',
            type: "post",
            error: function () {
                alert("1234");
            },
            success: function (data) {
                var course = data["course"];
                console.log("course.length:" + course.length)
                for (var aa = 0; aa < course.length; aa++) {
                    var cid = course[aa]["cid"];
                    console.log("cid:" + cid)
                    var cname = course[aa]["cname"];
                    console.log("cname:" + cname)
                    document.getElementById("optgroup_Cname").innerHTML +=
                        "<option value=\"" + cid + "\" >" + cname + "</option>";

                }
            }
        })
    }

</script>

</html>
